Skip to content

Instantly share code, notes, and snippets.

@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@vkz
vkz / hoot.md
Last active May 18, 2024 20:56
Tailscale your AWS and on-prem resources: have your cake and eat it too

Tailscaling git.ht

This [hoot][] you're about to read started its life as a gist of technical minutae I had to discover to Tailscale cloud and on-prem resources. It'd be too boring for me to just publish it, so I thought I'd give a little bit of context as a preamble. I get to rant some and you can simply skip to the technical sections below if you'd rather not indulge me.

Ranty preamble

How much of what AWS gives you do you really truly need? It's become Kubernetes this, Docker that. I rarely question it when contracting because contractors usually arrive after the fact to pick up and carry the pieces. You get to target the infrastructure that may as well have been installed by alients before humankind ascended in Amazon. All in the cloud, can't touch, jumpbox this, terraform that, re-create the world every time you sneeze, etc. It's different when you're hired fo

#include <avr/interrupt.h>
#include <avr/sleep.h>
// Arduino IDE settings
// BOD: 1.8V
// Clock: 1.2 MHz
// ATTiny13 pins/legs
// Leg 8: VCC
// Leg 4: GND
@thoemmi
thoemmi / Clear-NuGetCache.ps1
Created April 21, 2017 21:11
Script to delete old NuGet packages from %USERPROFILE%\.nuget\packages which haven't been accessed for 150 days
[CmdletBinding(SupportsShouldProcess=$True)]
Param(
[int]$CutoffDays = 150
)
$cutoffDate = (Get-Date).AddDays(-$CutoffDays)
# get path to cached NuGet packages ("%USERPROFILE$\.nuget\packages")
$nugetCachePath = Join-Path "$([System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile))" ".nuget\packages"
@dogterbox
dogterbox / controller.py
Created April 20, 2019 19:07
python MVC with tkinter
import tkinter as Tk
from models import Model
from views import View
class Controller():
def __init__(self):
self.root = Tk.Tk()
self.model = Model()
# Pass to view links on root frame and controller object
defmodule CsvReader do
@demo """
1,18,tim
2,35,jon
5,23,tom
"""
def load(csv, type \\ :tuple) when is_binary(csv) and type in [:tuple, :map] do
csv
|> parse_csv(type)
end
@sid24rane
sid24rane / net.js
Last active May 18, 2024 20:50
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});
@qoomon
qoomon / conventional_commit_messages.md
Last active May 18, 2024 20:48
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@Ravarcheon
Ravarcheon / spectralRotation.py
Created May 18, 2024 13:23
rotates an audio file by 90 degrees in the spectrum while being a reversible process with minimal loss (only floating point errors which are like -150 dB but thats literally silence ahaha~)
import numpy as np
import soundfile as sf
from scipy.fftpack import fft, ifft
def rotateSignal(signal,flip):
if flip:
signal = signal[::-1]
x = np.concatenate((signal, signal[1:][::-1])) # concatenating the array with a reverse of itself makes it such that the fourier transform doesn't layer over a reversed version of itself in the inverse fft
rotSig = np.real(ifft(x))